package vn.fpt.fsoft.entities;


import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;


/**
 * Author:	DuongPV1
 * Entity Contact mapping with table Contact in database
 * 
 * */
@Entity
@Table(name="Contact")
public class Contact implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -4205231019925816033L;
	private int contactId;
	private ContactType contactType;
	private Contact contact;
	private String firstName;
	private String surname;
	private String knownAs;
	private String officePhone;
	private String mobilePhone;
	private String homePhone;
	private String email;
	private String bestContactMethod;
	private String jobRole;
	private String workbase;
	private String jobTitle;
	private Boolean status;
	private Set<Contact> contacts = new HashSet<Contact>(0);
	private Set<Team> teams = new HashSet<Team>(0);
	private Set<Department> departments=new HashSet<Department>(0);
	private Set<Directorate> directorates=new HashSet<Directorate>(0);
	private Set<Programme> programmes = new HashSet<Programme>(0);
	private Set<Service> services = new HashSet<Service>(0);
	private Set<Organisation> organisations = new HashSet<Organisation>(0);

	public Contact() {
		// TODO Auto-generated constructor stub
	}
	
	@Id
	@GeneratedValue
	@Column(name="ContactID",nullable=false,unique=true)
	public int getContactId() {
		return contactId;
	}

	public void setContactId(int contactId) {
		this.contactId = contactId;
	}
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="ContactTypeID",nullable=true)
	public ContactType getContactType() {
		return contactType;
	}

	public void setContactType(ContactType contactType) {
		this.contactType = contactType;
	}
	
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="ManagerID",nullable=true)
	public Contact getContact() {
		return contact;
	}

	public void setContact(Contact contact) {
		this.contact = contact;
	}
	@Column(name="FirstName",nullable=true,length=50)
	public String getFirstName() {
		return firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}
	@Column(name="Surname",nullable=true,length=50)
	public String getSurname() {
		return surname;
	}

	public void setSurname(String surname) {
		this.surname = surname;
	}
	@Column(name="KnownAs",nullable=true,length=50)
	public String getKnownAs() {
		return knownAs;
	}

	public void setKnownAs(String knownAs) {
		this.knownAs = knownAs;
	}
	@Column(name="OfficePhone",nullable=true,length=50)
	public String getOfficePhone() {
		return officePhone;
	}

	public void setOfficePhone(String officePhone) {
		this.officePhone = officePhone;
	}
	@Column(name="MobilePhone",nullable=true,length=50)
	public String getMobilePhone() {
		return mobilePhone;
	}

	public void setMobilePhone(String mobilePhone) {
		this.mobilePhone = mobilePhone;
	}
	@Column(name="HomePhone",nullable=true,length=50)
	public String getHomePhone() {
		return homePhone;
	}

	public void setHomePhone(String homePhone) {
		this.homePhone = homePhone;
	}
	@Column(name="Email",nullable=true,length=50)
	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}
	@Column(name="BestContactMethod",nullable=true,length=50)
	public String getBestContactMethod() {
		return bestContactMethod;
	}

	public void setBestContactMethod(String bestContactMethod) {
		this.bestContactMethod = bestContactMethod;
	}
	@Column(name="JobRole",nullable=true,length=50)
	public String getJobRole() {
		return jobRole;
	}

	public void setJobRole(String jobRole) {
		this.jobRole = jobRole;
	}
	@Column(name="Workbase",nullable=true,length=50)
	public String getWorkbase() {
		return workbase;
	}

	public void setWorkbase(String workbase) {
		this.workbase = workbase;
	}
	@Column(name="JobTitle",nullable=true,length=50)
	public String getJobTitle() {
		return jobTitle;
	}

	public void setJobTitle(String jobTitle) {
		this.jobTitle = jobTitle;
	}
	@Column(name="Status",nullable=true,length=50)
	public Boolean getStatus() {
		return status;
	}

	public void setStatus(Boolean status) {
		this.status = status;
	}
	@OneToMany(fetch=FetchType.LAZY,mappedBy="contact")
	public Set<Contact> getContacts() {
		return contacts;
	}

	public void setContacts(Set<Contact> contacts) {
		this.contacts = contacts;
	}
	@OneToMany(fetch=FetchType.LAZY,mappedBy="contact")
	public Set<Team> getTeams() {
		return teams;
	}

	public void setTeams(Set<Team> teams) {
		this.teams = teams;
	}
	@OneToMany(fetch=FetchType.LAZY,mappedBy="contact")	
	public Set<Department> getDepartments() {
		return departments;
	}

	public void setDepartments(Set<Department> departments) {
		this.departments = departments;
	}
	@OneToMany(fetch=FetchType.LAZY,mappedBy="contact")
	public Set<Directorate> getDirectorates() {
		return directorates;
	}

	public void setDirectorates(Set<Directorate> directorates) {
		this.directorates = directorates;
	}
	@OneToMany(fetch=FetchType.LAZY,mappedBy="contact")
	public Set<Programme> getProgrammes() {
		return programmes;
	}

	public void setProgrammes(Set<Programme> programmes) {
		this.programmes = programmes;
	}
	@OneToMany(fetch=FetchType.LAZY,mappedBy="contact")
	public Set<Service> getServices() {
		return services;
	}

	public void setServices(Set<Service> services) {
		this.services = services;
	}
	@OneToMany(fetch=FetchType.LAZY,mappedBy="contact")
	public Set<Organisation> getOrganisations() {
		return organisations;
	}

	public void setOrganisations(Set<Organisation> organisations) {
		this.organisations = organisations;
	}
	

}
